package org.javaboy.storage.controller;

import org.javaboy.storage.service.StorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.service.annotation.PostExchange;

import java.util.Map;

@RestController
public class StorageController {

    @Autowired
    StorageService storageService;

    /**
     * 扣库存
     *
     * @return
     */
    @PostMapping("/deduce")
    public Map<String, Object> deduce(Integer commodityCode, Integer count) {
        return storageService.deduce(commodityCode, count);
    }
}
